import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/HomeView.vue')
    },
    {
      path: '/favor',
      name: 'favor',
      component: () => import('../views/favor/FavorView.vue')
    },
    {
      path: '/order',
      name: 'order',
      component: () => import('../views/order/OrderView.vue')
    },
    {
      path: '/message',
      name: 'message',
      component: () => import('../views/message/MessageView.vue')
    },
    {
      path: '/city',
      name: 'city',
      component: () => import('../views/city/CityView.vue'),
      meta: {
        // 控制底部Tab栏的显示与隐藏
        // 其余默认为 hideTabBar:undefined
        // hideTabBar: true
      }
    },
    {
      path: '/search',
      name: 'search',
      component: () => import('../views/searchBtn/searchBtnView.vue'),
      meta: {
        hideTabBar: true
      }
    },
    {
      path: '/detail/:houseId',
      name: 'detail',
      component: () => import('../views/detail/DetailView.vue'),
      meta: {
        hideTabBar: true
      }
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: () => import('../views/NotFoundView.vue')
    }
  ]
})

export default router
